<template>
<h3>
    {{ itplay.name }}
</h3>
<p>{{ itplayContent }}</p>
<p>{{ itplayContents() }}</p>
</template>

<script>

export default{

    data () {
        return {
            itplay:{
                name:"测试名称",
                content:["demo111","demo222","demo333"]
            }
        }
    },
    computed: {
        // 表达式不变 ：多次调用 计算一次
        itplayContent(){
            return this.itplay.content.length > 0? "YES" : "NO"
        }
    },
    methods: {
        // 表达式不变 ：多次调用 计算多次
        itplayContents(){
            return this.itplay.content.length > 0? "YES" : "NO"
        }
    },
}
</script>